//
//  Device.h
//  DYLYJ
//
//  Created by JM on 15/10/24.
//  Copyright © 2015年 JM. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MJExtension.h"
#import <XPGWifiSDK/XPGWifiSDK.h>
#import "DYSMSCenter.h"
//// 创建 通知类型
//[DYSMSCenter createSMSType:SCIENCE];
//
//// 添加接收者到指定的通知类型
//[DYSMSCenter addRecever:self
//            withSMSType:SCIENCE];
//
//// 消息中心发送通知
//[DYSMSCenter sendMessage:@"场景变化" byType:SCIENCE];


@interface XPGWifiDevice(MJ)<MJCoding>
@end

@interface Device : NSObject<MJCoding>
@property (assign, nonatomic) BOOL haveReceiveDataState;
@property (assign, nonatomic) BOOL isHidden;
@property (weak, nonatomic) id<XPGWifiDeviceDelegate> deleagete;
@property (strong, nonatomic)XPGWifiDevice *xpgDevice;
@property (copy, nonatomic) NSString *iconName;
@property (copy, nonatomic) NSString *name;
@property (copy, nonatomic) NSString *state;
@property (assign, nonatomic,getter=isOpen)   BOOL open;
@property (copy, nonatomic) NSString * switchColor;

@property (nonatomic, copy) NSString *macAddress;

+ (instancetype)deviceWithIcon:(NSString *) aIconName name:(NSString *)aName state:(NSString *) aState open:(BOOL) aOpen;
+ (instancetype)deviceWith:(XPGWifiDevice*) aDevice;

- (void)setDeviceReceiveData:(NSDictionary *)dataDic;

//BOOL Close_On = [data[@"entity0"][@"Close_On"] boolValue];
//BOOL Open_On = [data[@"entity0"][@"Open_On"] boolValue];
//BOOL Stop_On = [data[@"entity0"][@"Stop_On"] boolValue];
//BOOL c = [data[@"entity0"][@"Xiaodu_OnOff"] boolValue];
//BOOL Fenggan_OnOff = [data[@"entity0"][@"Fenggan_OnOff"] boolValue];
//BOOL Honggan_OnOff = [data[@"entity0"][@"Honggan_OnOff"] boolValue];
//BOOL LED_OnOff = [data[@"entity0"][@"LED_OnOff"] boolValue];

@property (assign, nonatomic) BOOL isClose_On;
@property (assign, nonatomic) BOOL isOpen_On;
@property (assign, nonatomic) BOOL isStop_On;

@property (assign, nonatomic) BOOL isXiaodu_On;
@property (assign, nonatomic) BOOL isFenggan_On;
@property (assign, nonatomic) BOOL isHonggan_On;
@property (assign, nonatomic) BOOL isLED_On;
@property (assign, nonatomic) BOOL isPower_on;//Auto_OnOff
//
//// aSMSType: self.macAddress  message:self
//- (void) dy_addObserver:(id<DYSMSProtocol>) aRecerver;
//- (void) dy_removeObserver:(id<DYSMSProtocol>) aRecerver;

@end
